<?php
/**
 * changxm   test
 * 2011-11 家教网 第一个文件
 *
 */
class TestAction extends Action
{
    /**
    +----------------------------------------------------------
    * 默认操作
    +----------------------------------------------------------
    */
    public function index()
    {
        //dump('-我这里test是内容-');
        $m = M('Test');
        $data = $m->findall();        
        $a_links = '';
        foreach ($data as $k=>$v){
        	$a_links .= '<a href=/test/show/'.$v['id'].'>'.$v['name'].'</a> <br />';
        }
        $this->assign('aaa', $data);
        $this->assign('a_links', $a_links);
        $this->display();
    	//$this->display(THINK_PATH.'/Tpl/Autoindex/hello.html');
    }
    
    public function show(){
    	$id = $_GET['id'];
    	$m = M('Test');
    	$data = $m->where('id='.$id)->select();
    	dump($data);
    }
    


}
?>